# -*- coding;utf-8 -*-
"""
File name : ChatCompletion.py.PY
Program IDE : PyCharm
Create file time: 2023/9/23 20:45
File Create By Author : 朱清闯
"""


def chat_completion():
    group_id = "1695462725457822"
    api_key = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJOYW1lIjoi6aKY5bqT572RIiwiU3ViamVjdElEIjoiMTY5NTQ2MjcyNTk1NTY3NyIsIlBob25lIjoiIiwiR3JvdXBJRCI6IjE2OTU0NjI3MjU0NTc4MjIiLCJQYWdlTmFtZSI6IiIsIk1haWwiOiIyNzE3NzQ3MTZAcXEuY29tIiwiQ3JlYXRlVGltZSI6IjIwMjMtMDktMjMgMTk6MjY6MjIiLCJpc3MiOiJtaW5pbWF4In0.pDZsZyPa9TbXdZH_dBexErp3aHzRo4TU6nSDrGkYc07jXide4rlL-glThbGL4nHUPVJlU3NPiACOYUDjsUPVctI0fhmi30xIj6QT2Wh4nsOniCJDdEbDYGDiK1SWM0EUVBgzShE9CqaalXEL1fZ2ETuKLoG6ylKSEzSXdGV8M5J-zZOd8bwitPuxwepvE58kXKbhYiTvYk6RZwNHAktO-FTA7a5yB_A2LPqMnUDl4Kpp-PctcKuTM4mEQDP81o8EPvdLGYlSyoksbsBo9KSDUN-3BOKkWBpgCUR2ee98p-tGV62NQxugO2Wv562yg--US3PgNpb26YZm3_U2Hu0oFw"

    url = f"https://api.minimax.chat/v1/text/chatcompletion_pro?GroupId={group_id}"
    headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}

    # tokens_to_generate/bot_setting/reply_constraints可自行修改
    request_body = {
        "model": "abab5.5-chat",
        "tokens_to_generate": 1024,
        "reply_constraints": {"sender_type": "BOT", "sender_name": "MM智能助理"},
        "messages": [],
        "bot_setting": [
            {
                "bot_name": "MM智能助理",
                "content": "MM智能助理是一款由MiniMax自研的，没有调用其他产品的接口的大型语言模型。MiniMax是一家中国科技公司，一直致力于进行大模型相关的研究。",
            }
        ],
    }
    return url, headers, request_body
